import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

export function PermissionList(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/getSysResourceByPage',
    method: 'get',
    params
  })
}

export function LoadPermissionType(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/getSysResourceByType',
    method: 'get',
    params
  })
}
export function SavePermission(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/addSysResource',
    method: 'post',
    data: params
  })
}
export function DelPermission(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/deleteResource',
    method: 'get',
    params
  })
}
export function GetPermission(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/findSysResourceById',
    method: 'get',
    params
  })
}
export function UpdatePermission(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/updateSysResource',
    method: 'post',
    data: params
  })
}

export function getFunctionPermission(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/getFunctionPermission',
    method: 'get',
    params
  })
}

export function getUserPermissionInfo(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/permission/getUserPermissionInfo',
    method: 'get',
    params
  })
}


export function getResourceTree(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/sysMenu/getResourceTree',
    method: 'get',
    params
  })
}
